#include "base/timeeventset.h"
#include "base/timeevent.h"
namespace net_tools::base
{

  Timeevent::Timeevent(func func, timeval begin_time, Timeeventset *timeeventset)
      : func_(std::move(func)),
        next_time_(begin_time),
        before_(nullptr),
        next_(nullptr),
        timeeventset_(timeeventset){};
  Timeevent::~Timeevent()
  {
    timeeventset_->Del_timejob(this);
  };
  void Timeevent::Add_set()
  {
    timeeventset_->Add_timejob(this);
  };

} // namespace net_tools::base